diff mbox

[1/3] cifs: Fix bug when checking error condition in cifs_rename_pending_delete()

Message ID 1362511557-22607-2-git-send-email-sprabhu@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Prabhu March 5, 2013, 7:25 p.m. UTC
Fix check for error condition after setting attributes with
CIFSSMBSetFileInfo().

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
---
 fs/cifs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Layton March 6, 2013, 12:35 p.m. UTC | #1
On Tue,  5 Mar 2013 19:25:55 +0000
Sachin Prabhu <sprabhu@redhat.com> wrote:

> Fix check for error condition after setting attributes with
> CIFSSMBSetFileInfo().
> 
> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
> ---
>  fs/cifs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index ed6208f..a183b9d 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1014,7 +1014,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
>  					current->tgid);
>  		/* although we would like to mark the file hidden
>   		   if that fails we will still try to rename it */
> -		if (rc != 0)
> +		if (!rc)
>  			cifsInode->cifsAttrs = dosattr;
>  		else
>  			dosattr = origattr; /* since not able to change them */

Nice catch

Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
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
Pavel Shilovsky March 6, 2013, 3:39 p.m. UTC | #2
2013/3/6 Jeff Layton <jlayton@redhat.com>:
> On Tue,  5 Mar 2013 19:25:55 +0000
> Sachin Prabhu <sprabhu@redhat.com> wrote:
>
>> Fix check for error condition after setting attributes with
>> CIFSSMBSetFileInfo().
>>
>> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
>> ---
>>  fs/cifs/inode.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
>> index ed6208f..a183b9d 100644
>> --- a/fs/cifs/inode.c
>> +++ b/fs/cifs/inode.c
>> @@ -1014,7 +1014,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
>>                                       current->tgid);
>>               /* although we would like to mark the file hidden
>>                  if that fails we will still try to rename it */
>> -             if (rc != 0)
>> +             if (!rc)
>>                       cifsInode->cifsAttrs = dosattr;
>>               else
>>                       dosattr = origattr; /* since not able to change them */
>
> Nice catch
>
> Reviewed-by: Jeff Layton <jlayton@redhat.com>
> --
> 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>
diff mbox

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ed6208f..a183b9d 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1014,7 +1014,7 @@  cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
 					current->tgid);
 		/* although we would like to mark the file hidden
  		   if that fails we will still try to rename it */
-		if (rc != 0)
+		if (!rc)
 			cifsInode->cifsAttrs = dosattr;
 		else
 			dosattr = origattr; /* since not able to change them */