diff mbox

cifs: add FL_CLOSE to fl_flags mask in cifs_read_flock

Message ID 1347568691-24628-1-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Sept. 13, 2012, 8:38 p.m. UTC
FL_CLOSE is quite common when you close a file on which you hold a
lock. The spurious "Unknown lock flags" message in cFYI is
confusing in this case.

Reported-by: Alexander Bokovoy <abokovoy@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Pavel Shilovsky Sept. 14, 2012, 11:36 a.m. UTC | #1
2012/9/14 Jeff Layton <jlayton@redhat.com>:
> FL_CLOSE is quite common when you close a file on which you hold a
> lock. The spurious "Unknown lock flags" message in cFYI is
> confusing in this case.
>
> Reported-by: Alexander Bokovoy <abokovoy@redhat.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/file.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 093f5a3..33158cd 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1173,7 +1173,8 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
>         if (flock->fl_flags & FL_LEASE)
>                 cFYI(1, "Lease on file - not implemented yet");
>         if (flock->fl_flags &
> -           (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE)))
> +           (~(FL_POSIX | FL_FLOCK | FL_SLEEP |
> +              FL_ACCESS | FL_LEASE | FL_CLOSE)))
>                 cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags);
>
>         *type = server->vals->large_lock_type;
> --
> 1.7.11.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Steve French Sept. 15, 2012, 8:54 p.m. UTC | #2
Merged into cifs-2.6.git

On Fri, Sep 14, 2012 at 6:36 AM, Pavel Shilovsky <piastryyy@gmail.com> wrote:
> 2012/9/14 Jeff Layton <jlayton@redhat.com>:
>> FL_CLOSE is quite common when you close a file on which you hold a
>> lock. The spurious "Unknown lock flags" message in cFYI is
>> confusing in this case.
>>
>> Reported-by: Alexander Bokovoy <abokovoy@redhat.com>
>> Signed-off-by: Jeff Layton <jlayton@redhat.com>
>> ---
>>  fs/cifs/file.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
>> index 093f5a3..33158cd 100644
>> --- a/fs/cifs/file.c
>> +++ b/fs/cifs/file.c
>> @@ -1173,7 +1173,8 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
>>         if (flock->fl_flags & FL_LEASE)
>>                 cFYI(1, "Lease on file - not implemented yet");
>>         if (flock->fl_flags &
>> -           (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE)))
>> +           (~(FL_POSIX | FL_FLOCK | FL_SLEEP |
>> +              FL_ACCESS | FL_LEASE | FL_CLOSE)))
>>                 cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags);
>>
>>         *type = server->vals->large_lock_type;
>> --
>> 1.7.11.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
>
> --
> Best regards,
> Pavel Shilovsky.
diff mbox

Patch

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 093f5a3..33158cd 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1173,7 +1173,8 @@  cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
 	if (flock->fl_flags & FL_LEASE)
 		cFYI(1, "Lease on file - not implemented yet");
 	if (flock->fl_flags &
-	    (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE)))
+	    (~(FL_POSIX | FL_FLOCK | FL_SLEEP |
+	       FL_ACCESS | FL_LEASE | FL_CLOSE)))
 		cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags);
 
 	*type = server->vals->large_lock_type;